package com.smartlifev30.baiwei.activity;

import android.support.v7.app.AppCompatActivity;
import android.os.Bundle;
import android.support.v7.widget.LinearLayoutManager;
import android.support.v7.widget.RecyclerView;
import android.view.View;
import android.widget.ImageView;
import android.widget.Toast;

import com.smartlifev30.R;
import com.smartlifev30.baiwei.adapter.DoorLockAdapter;
import com.smartlifev30.baiwei.view.recyclerViewComponent.BaseAdapter;

import java.util.ArrayList;

/**
 * @author tys
 */
public class DoorLockActivity extends AppCompatActivity {
    private RecyclerView recycleView;
    private DoorLockAdapter doorLockAdapter;
    private ImageView info;

    @Override
    protected void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.activity_door);
        initView();
    }

    private void initView() {
        recycleView = findViewById(R.id.door_recycle_view);
        recycleView.setLayoutManager(new LinearLayoutManager(this));
        doorLockAdapter = new DoorLockAdapter(this, new ArrayList<>());
        doorLockAdapter.setItemClickListen((itemView, position) -> {
            Toast.makeText(DoorLockActivity.this, position + "", Toast.LENGTH_SHORT).show();
        });
        recycleView.setAdapter(doorLockAdapter);
    }
}
